package net.hn.hnms.biz.plan.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;


/**
 * @author gzr
 * @date 2023年2月20日14:23:13
 */
@Data
@ApiModel("生产调度年度报表")
public class StatisticalYearVo {
    public StatisticalYearVo() {
    }


    /**
     * 一月     Jan.     January
     * 二月    Feb.      February
     * 三月    Mar.     March
     * 四月    Apr.     April
     * 五月    May.     May
     * 六月    Jun.      June
     * 七月    Jul.       July
     * 八月    Aug.     August
     * 九月    Sept.     September
     * 十月     Oct.       October
     * 十一月 Nov.       November
     * 十二月 Dec.      December
     */
    //1月到12月计划
    @ApiModelProperty(value = "一月计划量")
    private String jan = "--";
    @ApiModelProperty(value = "二月计划量")
    private String feb = "--";
    @ApiModelProperty(value = "三月计划量")
    private String mar = "--";
    @ApiModelProperty(value = "四月计划量")
    private String apr = "--";
    @ApiModelProperty(value = "五月计划量")
    private String may = "--";
    @ApiModelProperty(value = "六月计划量")
    private String jun = "--";
    @ApiModelProperty(value = "七月计划量")
    private String jul = "--";
    @ApiModelProperty(value = "八月计划量")
    private String aug = "--";
    @ApiModelProperty(value = "九月计划量")
    private String sept = "--";
    @ApiModelProperty(value = "十月计划量")
    private String oct = "--";
    @ApiModelProperty(value = "十一月计划量")
    private String nov = "--";
    @ApiModelProperty(value = "十二月计划量")
    private String dec = "--";
    //季度计划
    @ApiModelProperty(value = "一季度计划量")
    private String firstQuarter = "--";
    @ApiModelProperty(value = "二季度计划量")
    private String secondQuarter = "--";
    @ApiModelProperty(value = "三季度计划量")
    private String thirdQuarter = "--";
    @ApiModelProperty(value = "四季度计划量")
    private String fourthQuarter = "--";
    //年度计划
    @ApiModelProperty(value = "年度计划量")
    private String yearPlan = "--";
    //1月到12月超欠
    @ApiModelProperty(value = "一月超欠")
    private String janBackbreak = "--";
    @ApiModelProperty(value = "二月超欠")
    private String febBackbreak = "--";
    @ApiModelProperty(value = "三月超欠")
    private String marBackbreak = "--";
    @ApiModelProperty(value = "四月超欠")
    private String aprBackbreak = "--";
    @ApiModelProperty(value = "五月超欠")
    private String mayBackbreak = "--";
    @ApiModelProperty(value = "六月超欠")
    private String junBackbreak = "--";
    @ApiModelProperty(value = "七月超欠")
    private String julBackbreak = "--";
    @ApiModelProperty(value = "八月超欠")
    private String augBackbreak = "--";
    @ApiModelProperty(value = "九月超欠")
    private String septBackbreak = "--";
    @ApiModelProperty(value = "十月超欠")
    private String octBackbreak = "--";
    @ApiModelProperty(value = "十一月超欠")
    private String novBackbreak = "--";
    @ApiModelProperty(value = "十二月超欠")
    private String decBackbreak = "--";

    //季度超欠
    @ApiModelProperty(value = "一季度超欠")
    private String firstQuarterBackbreak = "--";
    @ApiModelProperty(value = "二季度超欠")
    private String secondQuarterBackbreak = "--";
    @ApiModelProperty(value = "三季度超欠")
    private String thirdQuarterBackbreak = "--";
    @ApiModelProperty(value = "四季度超欠")
    private String fourthQuarterBackbreak = "--";
    //年度超欠
    @ApiModelProperty(value = "年度超欠")
    private String yearOutputBackbreak = "--";

    //1月 到12月完成
    @ApiModelProperty(value = "一月完成量")
    private String janActual = "--";
    @ApiModelProperty(value = "二月完成量")
    private String febActual = "--";
    @ApiModelProperty(value = "三月完成量")
    private String marActual = "--";
    @ApiModelProperty(value = "四月完成量")
    private String aprActual = "--";
    @ApiModelProperty(value = "五月完成量")
    private String mayActual = "--";
    @ApiModelProperty(value = "六月完成量")
    private String junActual = "--";
    @ApiModelProperty(value = "七月完成量")
    private String julActual = "--";
    @ApiModelProperty(value = "八月完成量")
    private String augActual = "--";
    @ApiModelProperty(value = "九月完成量")
    private String septActual = "--";
    @ApiModelProperty(value = "十月完成量")
    private String octActual = "--";
    @ApiModelProperty(value = "十一月完成量")
    private String novActual = "--";
    @ApiModelProperty(value = "十二月完成量")
    private String decActual = "--";

    //季度产量
    @ApiModelProperty(value = "一季度季度完成量")
    private String firstQuarterActual = "--";
    @ApiModelProperty(value = "二季度季度完成量")
    private String secondQuarterActual = "--";
    @ApiModelProperty(value = "三季度季度完成量")
    private String thirdQuarterActual = "--";
    @ApiModelProperty(value = "四季度季度完成量")
    private String fourthQuarterActual = "--";



    //年度产量
    @ApiModelProperty(value = "年度完成量")
    private String yearActual = "--";

    /**
     * 计算年度超欠   月度超欠   季度超欠
     * @param statisticalYearVo
     * @return
     */
    public StatisticalYearVo calculatebackBreak(StatisticalYearVo statisticalYearVo) {
        //月度超欠
        if (!"--".equals(statisticalYearVo.getJan())&&!"--".equals(statisticalYearVo.getJanActual())){

            statisticalYearVo.setJanBackbreak(((new BigDecimal(statisticalYearVo.getJanActual())).subtract(new BigDecimal(statisticalYearVo.getJan())))+"");
        }
        if (!"--".equals(statisticalYearVo.getFeb())&&!"--".equals(statisticalYearVo.getFebActual())){
            statisticalYearVo.setFebBackbreak(((new BigDecimal(statisticalYearVo.getFebActual())).subtract(new BigDecimal(statisticalYearVo.getFeb())))+"");
        }
        if (!"--".equals(statisticalYearVo.getMar())&&!"--".equals(statisticalYearVo.getMarActual())){
            statisticalYearVo.setMarBackbreak(((new BigDecimal(statisticalYearVo.getMarActual())).subtract(new BigDecimal(statisticalYearVo.getMar())))+"");
        }
        if (!"--".equals(statisticalYearVo.getApr())&&!"--".equals(statisticalYearVo.getAprActual())){
            statisticalYearVo.setAprBackbreak(((new BigDecimal(statisticalYearVo.getAprActual())).subtract(new BigDecimal(statisticalYearVo.getApr())))+"");
        }
        if (!"--".equals(statisticalYearVo.getMay())&&!"--".equals(statisticalYearVo.getMayActual())){
            statisticalYearVo.setMayBackbreak(((new BigDecimal(statisticalYearVo.getMayActual())).subtract(new BigDecimal(statisticalYearVo.getMay())))+"");
        }
        if (!"--".equals(statisticalYearVo.getJun())&&!"--".equals(statisticalYearVo.getJunActual())){
            statisticalYearVo.setJunBackbreak(((new BigDecimal(statisticalYearVo.getJunActual())).subtract(new BigDecimal(statisticalYearVo.getJun())))+"");
        }
        if (!"--".equals(statisticalYearVo.getJul())&&!"--".equals(statisticalYearVo.getJulActual())){
            statisticalYearVo.setJulBackbreak(((new BigDecimal(statisticalYearVo.getJulActual())).subtract(new BigDecimal(statisticalYearVo.getJul())))+"");
        }
        if (!"--".equals(statisticalYearVo.getAug())&&!"--".equals(statisticalYearVo.getAugActual())){
            statisticalYearVo.setAugBackbreak(((new BigDecimal(statisticalYearVo.getAugActual())).subtract(new BigDecimal(statisticalYearVo.getAug())))+"");
        }
        if (!"--".equals(statisticalYearVo.getSept())&&!"--".equals(statisticalYearVo.getSeptActual())){
            statisticalYearVo.setSeptBackbreak(((new BigDecimal(statisticalYearVo.getSeptActual())).subtract(new BigDecimal(statisticalYearVo.getSept())))+"");
        }
        if (!"--".equals(statisticalYearVo.getOct())&&!"--".equals(statisticalYearVo.getOctActual())){
            statisticalYearVo.setOctBackbreak(((new BigDecimal(statisticalYearVo.getOctActual())).subtract(new BigDecimal(statisticalYearVo.getOct())))+"");
        }
        if (!"--".equals(statisticalYearVo.getNov())&&!"--".equals(statisticalYearVo.getNovActual())){
            statisticalYearVo.setNovBackbreak(((new BigDecimal(statisticalYearVo.getNovActual())).subtract(new BigDecimal(statisticalYearVo.getNov())))+"");
        }
        if (!"--".equals(statisticalYearVo.getDec())&&!"--".equals(statisticalYearVo.getDecActual())){
            statisticalYearVo.setDecBackbreak(((new BigDecimal(statisticalYearVo.getDecActual())).subtract(new BigDecimal(statisticalYearVo.getDec())))+"");
        }
        //年度超欠
        if (!"--".equals(statisticalYearVo.getYearPlan())&&!"--".equals(statisticalYearVo.getYearActual())){
            statisticalYearVo.setYearOutputBackbreak(((new BigDecimal(statisticalYearVo.getYearActual())).subtract(new BigDecimal(statisticalYearVo.getYearPlan())))+"");
        }
        //季度超欠
        if (!"--".equals(statisticalYearVo.getFirstQuarter())&&!"--".equals(statisticalYearVo.getFirstQuarterActual())){
            statisticalYearVo.setFirstQuarterBackbreak(((new BigDecimal(statisticalYearVo.getFirstQuarterActual())).subtract(new BigDecimal(statisticalYearVo.getFirstQuarter())))+"");
        }
        if (!"--".equals(statisticalYearVo.getSecondQuarter())&&!"--".equals(statisticalYearVo.getSecondQuarterActual())){
            statisticalYearVo.setSecondQuarterBackbreak(((new BigDecimal(statisticalYearVo.getSecondQuarterActual())).subtract(new BigDecimal(statisticalYearVo.getSecondQuarter())))+"");
        }
        if (!"--".equals(statisticalYearVo.getThirdQuarter())&&!"--".equals(statisticalYearVo.getThirdQuarterActual())){
            statisticalYearVo.setThirdQuarterBackbreak(((new BigDecimal(statisticalYearVo.getThirdQuarterActual())).subtract(new BigDecimal(statisticalYearVo.getThirdQuarter())))+"");
        }
        if (!"--".equals(statisticalYearVo.getFourthQuarter())&&!"--".equals(statisticalYearVo.getFourthQuarterActual())){
            statisticalYearVo.setFourthQuarterBackbreak(((new BigDecimal(statisticalYearVo.getFourthQuarterActual())).subtract(new BigDecimal(statisticalYearVo.getFourthQuarter())))+"");
        }
        return statisticalYearVo;
    }
}
